<script type="text/javascript" >
    layui.config({
        base:"{:C(JS_BASE_PATH)}"
    }).use(['layer','form','func'],function () {
        var  layer = layui.layer,
             form = layui.form(),
             func = layui.func,
             $ = layui.jquery;

        $("[event=del]").click(function () {
            var key = $(this).parents('tr').attr('key'),
                    data = $.dataSource.data[key];
            var params = {
                id : data.id
            };
            layer.confirm('确定删除该模型吗?',function () {
                func.ajax("{:U('drop')}",params);
            });
        });

        $("[event=dropBath]").click(function () {
            var datas = func.getSelectData('[data=checkbox]',$.dataSource.data);
            if(datas.length == 0){
                layer.msg('请选中要删除的模型');
                return false;
            }
            layer.confirm('确定删除选中的模型吗？',function () {
                var ids='',params;
                $.each(datas, function (key, data) {
                    ids+=data.id+',';
                });
                params = {
                    id: ids
                }
                func.ajax("{:U('drop')}",params);
            })
        })
    });
</script>